var fs = require("fs");
var path = require("path");

var filePath = path.join(__dirname, '/from.txt');
var filePath2 = path.join(__dirname, '/to.txt');

var readable = fs.createReadStream(filePath);
var writable = fs.createWriteStream(filePath2);


readable.on('data', function (chunk) {
    var str = chunk.toString('utf8');
    var str2 = '';
    for (var i = 0; i < str.length; i++) {
        str2 += str[i].toUpperCase();
    }
    writable.write(str2);
    writable.end();
})